package com.dfbz.demo01_卖票案例;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo11_线程优先级 {
    public static void main(String[] args) {


        Thread t1 = new Thread("线程A") {
            @Override
            public void run() {
                for (int i = 0; i <= 10000; i++) {
                    System.out.println(Thread.currentThread().getName()+i);
                }
            }
        };

        Thread t2 = new Thread("线程B") {
            @Override
            public void run() {
                for (int i = 0; i <= 10000; i++) {
                    System.out.println(Thread.currentThread().getName()+i);
                }
            }
        };


        t2.setPriority(10);
        t1.setPriority(1);

        t1.start();
        t2.start();
    }
}
